import { ElMessage, ElMessageBox, dayjs } from 'element-plus'
import Api from '@/api/index'
const components = {
  $ElMessage: ElMessage,
  $ElMessageBox: ElMessageBox,
  $Dayjs: dayjs,
  $Api: Api,
}

const install = app => {
  Object.keys(components).forEach(key => {
    window[key] = components[key]
    app.provide(key, components[key])
  })
}

export default install
